const HtmlWebpackPlugin = require('html-webpack-plugin')
// const ESLintPlugin = require('eslint-webpack-plugin')
// const path = require('path')
const { merge } = require('webpack-merge')
const common = require('./webpack.config.common.js')

module.exports = merge(common, {
  mode: 'development',
  plugins: [
    new HtmlWebpackPlugin({
      title: '开发环境',
      template: './public/index.html'
    })
  ],
  devServer: {
    port: 3000,
    open: true
  },
  // * 源码与编译后的代码的映射文件 便于调式
  // * eval-cheap-module-source-map 仅有行映射
  devtool: 'eval-cheap-module-source-map'
})
